import { MockMethod } from 'vite-plugin-mock'
import { SUCCESS_CODE } from '@/constants'

const timeout = 1000

export default [
  {
    url: '/api/borrow/list',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: {
          totalCount: 100,
          totalPage: 1,
          pageSize: 10,
          list: [
            {
              borrowId: 1,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 0,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            },
            {
              borrowId: 2,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 1,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            },
            {
              borrowId: 3,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 2,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            },
            {
              borrowId: 3,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 3,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            }
          ]
        }
      }
    }
  },
  {
    url: '/api/borrow/myBorrows',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: {
          totalCount: 100,
          totalPage: 1,
          pageSize: 10,
          list: [
            {
              borrowId: 1,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 0,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            },
            {
              borrowId: 2,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 1,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            },
            {
              borrowId: 3,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 2,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            },
            {
              borrowId: 3,
              userId: 2,
              equipmentId: 1,
              borrowQuantity: 1,
              preReturnTime: '2025-05-22 07:49:12',
              borrowStatus: 3,
              createTime: '2025-03-22 07:49:12',
              updateTime: '2025-03-22 07:53:29',
              equipmentName: '斯伯丁篮球（大号）',
              brand: '斯伯丁',
              model: '大号',
              equipmentTypeId: 1,
              equipmentTypeName: '篮球',
              username: 'fuyongde',
              userRealName: '傅永德'
            }
          ]
        }
      }
    }
  },
  // 申请
  {
    url: '/api/borrow/apply',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 审批
  {
    url: '/api/borrow/approve',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 拒绝
  {
    url: '/api/borrow/reject',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  },
  // 拒绝
  {
    url: '/api/borrow/return',
    method: 'post',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  }
] as MockMethod[]
